package cn.xp.fallback;


import cn.xp.dto.FloorDto;
import cn.xp.feign.DeviceFeignClient;
import cn.xp.util.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class DeviceFeignClientFallbackFactory implements FallbackFactory<DeviceFeignClient> {
    /*
     * @Description: 熔断托底方法
     * @param throwable:
     * @return: cn.itsource.feigenClients.DeviceFeignClient
     **/
    @Override
    public DeviceFeignClient create(Throwable throwable) {
        return id -> new JSONResult<FloorDto>();
    }
}